<template>
  <div>
    <el-form label-width="80px" :model="user">
      <el-form-item label="小区">
        <el-input v-model="user.area"></el-input>
      </el-form-item>
      <el-form-item label="楼号">
        <el-input v-model="user.floor"></el-input>
      </el-form-item>
      <el-form-item label="电话">
        <el-input v-model="user.phone">
        </el-input>
      </el-form-item>
      <el-form-item label="姓名">
        <el-input v-model="user.username">
        </el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm('user')">确认</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import request from '@/utils/request'

export default {
  name: 'index',
  data() {
    return {
      user: {}
    }
  },
  methods: {
    getUser() {
      let username = this.$route.query.usnername
      request().get('/detect/user/' + username).then(response => {
        this.user = response.date
      })
    },
    submitForm() {
      request().get('/detect/user/' + id).then(response => {
        this.user = response.date
      })
    }
  },

  created() {
  }
}
</script>

<style scoped>

</style>
